﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TNCAddIn
{
    public partial class SelectMonthForm : Form
    {
        public SelectMonthForm()
        {
            InitializeComponent();
            this.monthBtn.DialogResult = DialogResult.OK;
            this.monthBox.DropDownStyle = ComboBoxStyle.DropDownList;
            DateTime now = DateTime.Now;
            int y = now.Year;
            int m = now.Month;
            for (int i = 0; i < 3; i++ )
            {
                if (m == 0)
                {
                    y--;
                    m = 12;
                }
                if (m < 10)
                {
                    monthBox.Items.Add(y + "-0" + m);
                }
                else
                {
                    monthBox.Items.Add(y + "-" + m);
                }
                m--;
            }
            this.monthBox.SelectedIndex = 0;
        }

        public String Month
        {
            get { return this.monthBox.SelectedItem.ToString(); }
        }
    }
}
